﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style>
        #container
        {
            width:100%;
            height:100%;
        }
    </style>
    
    <script language="javascript">
        function randomizeDivs() {
            for (var i = 1; i <= 20; i++) {

                document.getElementById("div" + i).style.position = 'absolute';
                document.getElementById("div" + i).style.top = parseInt( 800*Math.random() ).toString() +"px"  ;
                document.getElementById("div" + i).style.left = parseInt(800 * Math.random()).toString() + "px";
              
                var color = (parseInt(Math.random() * 256 * 256 * 256)).toString(16);
                while (color.length < 6) color = "0" + color;
                document.getElementById("div" + i).style.color = '#' + color;

                document.getElementById("div" + i).style.fontSize = parseInt(72 * Math.random()).toString() + "pt";
                
            }
        }
        function createDivs() {
            var html = "";
            for (var i = 1; i <= 20; i++) {
                html += "<div id=\"div" + i + "\">This is div " + i + "</div>\n";
            }
            document.getElementById("container").innerHTML = html;
            setInterval(randomizeDivs, 50);
            
        }    

    </script>

</head>

<body onload="createDivs();">
    <div id="container">

    </div>
</body>
</html>
